package com.cedric.yixianpai.game.cards.Sects.swordCards.b_ZhuJi;

import com.cedric.yixianpai.game.Constants.Period;
import com.cedric.yixianpai.game.Status.DuelStatus;
import com.cedric.yixianpai.game.interfaces.SwordCard;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 凝意诀
 * 1SE+3/4/5SI
 */
@Component
public class NingYiJue extends SwordCard {
    public NingYiJue(@Value("1") int lvl) {
        super("凝意诀");
        this.setPeriod(Period.ZHUJI);
        this.setDescription("灵气+1 剑意+3/4/5");
        this.setLevel(lvl);

        this.setSpiritAdd(1);
        if(1==lvl){
            this.setSwordIntent(3);
        }else if(2==lvl){
            this.setSwordIntent(4);
        }else if(3==lvl){
            this.setSwordIntent(5);
        }else {
            throw new RuntimeException("卡牌等级错误)");
        }
    }

    @Override
    public boolean effect(DuelStatus Sta1, DuelStatus Sta2) {
        Sta1.getPlayerBuff().addSpiritualEnergy(this.getSpiritAdd());
        Sta1.getPlayerBuff().addSwordIntent(this.getSwordIntent());
        return true;
    }
}
